package com.cn.wanxi.service;

import com.cn.wanxi.model.NavModel;

import java.util.ArrayList;
import java.util.List;

public class NavService {
    /**
     * 封装list导航数据
     * 具体数据放在数组里面
     * 对象放在集合里面
     *
     * @return
     */
    public List<NavModel> getNavModelList() {
        List<NavModel> navModelList = new ArrayList<>();
        NavModel navModel = new NavModel();//作用就是为了得到循环的长度

        for (int i = 0; i < navModel.hrefs.length; i++) {
            NavModel model = new NavModel();//封装的具体对象
            //封装每一个具体对象然后加入list
            model.setHref(navModel.hrefs[i]);
            model.setTitle(navModel.titles.get(i));
            navModelList.add(model);
        }
//        for (NavModel aa:navModelList
//             ) {
//
//        }
        return navModelList;
    }
}
